﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import net.wooga.pets.controllers.data.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class ComputerModel extends Actor {

        private var _matrix:Array;
        private var _lastClickedPetId:String;

        public function ComputerModel(){
            this._matrix = [];
            super();
        }
        public function addEntry(_arg1:Array):void{
            if (!_arg1[10]){
                return;
            };
            var _local2:Object = {};
            var _local3:Array = [];
            this.addTreatment(_local3, "TreatmentGeneral", _arg1[0]);
            this.addTreatment(_local3, "TreatmentMental", _arg1[1]);
            this.addTreatment(_local3, "TreatmentPhysical", _arg1[2]);
            this.addTreatment(_local3, "TreatmentCosmetic", _arg1[3]);
            this.addTreatment(_local3, "RehaSport", _arg1[4]);
            this.addTreatment(_local3, "RehaFun", _arg1[5]);
            this.addTreatment(_local3, "RehaSpa", _arg1[6]);
            _local2.treatments = _local3;
            _local2.min = int(_arg1[7]);
            _local2.xp = int(_arg1[8]);
            _local2.coins = int(_arg1[9]);
            _local2.pet_name = _arg1[10];
            _local2.disease_name = _arg1[11];
            _local2.required_level = int(_arg1[12]);
            _local2.love = _arg1[13];
            _local2.fire = _arg1[14];
            _local2.water = _arg1[15];
            _local2.air = _arg1[16];
            _local2.star = _arg1[17];
            _local2.ice = _arg1[18];
            _local2.reward_icon = ((((((((((((_local2.love) && (GameConstants.LOVE))) || (((_local2.fire) && (GameConstants.FIRE))))) || (((_local2.water) && (GameConstants.WATER))))) || (((_local2.air) && (GameConstants.AIR))))) || (((_local2.star) && (GameConstants.STAR))))) || (((_local2.ice) && (GameConstants.ICE))));
            _local2.number_of_rewards = ((((((((((_local2.love) || (_local2.fire))) || (_local2.water))) || (_local2.air))) || (_local2.star))) || (_local2.ice));
            this._matrix.push(_local2);
            _local2.disease_index = this._matrix.length;
        }
        public function get matrix():Array{
            return (this._matrix.concat());
        }
        public function getNewPetInLevel(_arg1:int):String{
            var _local3:Object;
            var _local2 = "";
            for each (_local3 in this._matrix) {
                if (_local3.required_level == _arg1){
                    _local2 = ((_local3.pet_name + "_") + _local3.disease_name);
                    break;
                };
            };
            return (_local2.toLowerCase());
        }
        public function getPatientNameByDisease(_arg1:String):String{
            var _local2:Object;
            for each (_local2 in this._matrix) {
                if ((_local2.pet_name + _local2.disease_name) == _arg1){
                    return (_local2.pet_name);
                };
            };
            return (null);
        }
        public function getPatienPoolVoByDiseaseName(_arg1:String):PatientPoolVO{
            var _local2:Object;
            for each (_local2 in this._matrix) {
                if ((_local2.pet_name + _local2.disease_name) == _arg1){
                    return (new PatientPoolVO(_local2));
                };
            };
            return (null);
        }
        public function getRequiredLevelByPetName(_arg1:String):int{
            var _local2:String;
            var _local3:Object;
            for each (_local3 in this._matrix) {
                _local2 = _local3.pet_name;
                if (_local2.toLowerCase() == _arg1){
                    return (_local3.required_level);
                };
            };
            return (0);
        }
        private function addTreatment(_arg1:Array, _arg2:String, _arg3:int):void{
            if (_arg3){
                _arg1.push(_arg2);
            };
        }
        public function get lastClickedPetId():String{
            return (this._lastClickedPetId);
        }
        public function set lastClickedPetId(_arg1:String):void{
            this._lastClickedPetId = _arg1;
        }

    }
}//package net.wooga.pets.models 
